﻿using HPIT.RentHouse.DTO;
using HPIT.RentHouse.IService;
using HPIT.RentHouse.Service.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HPIT.RentHouse.Service
{
    public class IdNamesService : IIdNamesService
    {
        public List<IdNameDTO> GetList(string typeName)
        {
            RentHouseEntities db = new RentHouseEntities();
            BaseService<T_IdNames> baseService = new BaseService<T_IdNames>(db);
            List<IdNameDTO> list = baseService.GetList(a => a.TypeName == typeName).Select(a => new IdNameDTO()
            {
                Id = a.Id,
                Name = a.Name,
                TypeName = a.TypeName
            }).ToList();
            return list;
        }
    }
}
